require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")

platform :ios, '15.1'

prepare_react_native_project!
project_root = File.join(__dir__, '../../minimal-tester')
ENV['PROJECT_ROOT'] = project_root

target 'BrownfieldTester' do
  use_expo_modules!({
    projectRoot: project_root,
    exclude: [
      'expo-splash-screen'
    ],
  })

  config_command = [
    'node',
    '--no-warnings',
    '--eval',
    'require(\'expo/bin/autolinking\')',
    'expo-modules-autolinking',
    'react-native-config',
    '--json',
    '--platform',
    'ios',
    '--project-root',
    project_root,
    '--source-dir',
    "#{__dir__}"
  ]
  config = use_native_modules!(config_command)

  use_react_native!(
    :path => config[:reactNativePath],
    :hermes_enabled => true,
    # An absolute path to your application root.
    :app_path => "#{project_root}",
    :privacy_file_aggregation_enabled => true,
  )

  post_install do |installer|
    react_native_post_install(
      installer,
      config[:reactNativePath],
      :mac_catalyst_enabled => false,
    )
  end
end
